<template>
	<view class="container">
		<view class="list-cell b-b m-t" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">头像</text>
			<image :src="avatarUrl" style="width: 35px;height: 35px;top: 10px;"></image>
		</view>
		<view class="list-cell b-b" hover-class="cell-hover" :hover-stay-time="50" style="display:none">
			<text class="cell-tit">手机号</text>
			<text class="t-value">{{userInfo.mobile}}</text>
		</view>
		<view class="list-cell b-b" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">昵称</text>
			<text class="t-value">{{userInfo.nickName}}</text>
			<text style="display: none;" class="cell-more yticon icon-you"></text>
		</view>
		<view class="list-cell b-b" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">性别</text>
			<text class="t-value">{{userInfo.gender==1?'男':(userInfo.gender==2?'女':'保密')}}</text>
			<text style="display: none;" class="cell-more yticon icon-you"></text>
		</view>
		<view class="list-cell b-b" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit">地区</text>
			<text class="t-value">{{(userInfo.province==undefined?'保密':userInfo.province) + " "+(userInfo.city==undefined?'':userInfo.city)}}</text>
			<text style="display: none;" class="cell-more yticon icon-you"></text>
		</view>
	</view>
</template>

<script>
	import {
	    mapState,
		mapMutations  
	} from 'vuex'; 
	export default {
		data() {
			return {
				avatarUrl : '',
				city: '',
				url:''
			};
		},
		onLoad() {
			this.getData();
		},
		computed: {
			...mapState(['hasLogin','userInfo'])
		},
		methods:{
			getData(){
				if(this.userInfo!=''){
					this.avatarUrl = this.userInfo.avatarUrl;
				}else{
					this.avatarUrl = '/static/img/avatar.png'
				}
			}

		}
	}
</script>

<style lang='scss'>
	page{
		background: $page-color-base;
	}
	.t-value{
		color: #666;
		font-size: 16px;
	}
	.list-cell{
		display:flex;
		align-items:baseline;
		padding: 20upx $page-row-spacing;
		line-height:60upx;
		position:relative;
		background: #fff;
		justify-content: center;
		&.log-out-btn{
			margin-top: 40upx;
			.cell-tit{
				color: $uni-color-primary;
				text-align: center;
				margin-right: 0;
			}
		}
		&.cell-hover{
			background:#fafafa;
		}
		&.b-b:after{
			left: 30upx;
		}
		&.m-t{
			margin-top: 16upx; 
		}
		.cell-more{
			align-self: baseline;
			font-size:$font-lg;
			color:$font-color-light;
			margin-left:10upx;
		}
		.cell-tit{
			flex: 1;
			font-size: $font-base + 2upx;
			color: $font-color-dark;
			margin-right:10upx;
		}
		.cell-tip{
			font-size: $font-base;
			color: $font-color-light;
		}
		switch{
			transform: translateX(16upx) scale(.84);
		}
	}
	/*边框*/
	.b-b:after,
	.b-t:after {
		position: absolute;
		z-index: 3;
		left: 0;
		right: 0;
		height: 0;
		content: '';
		transform: scaleY(.5);
		border-bottom: 1px solid $border-color-base;
	}
	
	.b-b:after {
		bottom: 0;
	}
	
	.b-t:after {
		top: 0;
	}
</style>